import os


if __name__ == '__main__':
	# 安装pip并更新
	# os.system("py -m ensurepip --default-pip")
	# pipenv创建虚拟环境：
	# pip3 install pipenv -i https://pypi.tuna.tsinghua.edu.cn/simple/
	# pip3 install --upgrade pipenv -i https://pypi.tuna.tsinghua.edu.cn/simple/
	# pipenv install 创建虚拟环境
	# pipenv --venv 查看虚拟环境路径
	# pinenv shell 进入虚拟环境
	# pipenv install --pypi-mirror https://pypi.tuna.tsinghua.edu.cn/simple
	# pipenv install loguru
	# pipenv graph 查看包名
	# pip install pyinstaller -i https://pypi.tuna.tsinghua.edu.cn/simple/


	os.system("python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple/")

	# libs = ["configparser", "subprocess", "uiautomator2", "loguru", "openpyxl", "pyzentao"
	# 		"pytest-ordering", "allure-pytest", "pytest", "pytest-sugar", "pytest-rerunfailures", "pyusb", "pyscard"]

	libs = ["loguru", "openpyxl", "pyzentao", "pyqt5-tools", "pyqt5"]  #, "pyqt5-tools"

	#循环遍历安装
	for lib in libs:
		os.system("pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ " + lib)
		# os.system("pipenv install -i https://pypi.tuna.tsinghua.edu.cn/simple/ " + lib) #--target=./venv



# pytest~=7.1.2
# pytest-html-reporter~=0.2.9
# pytest-rerunfailures>=10.2
# pytest-ordering>=0.6
# pytest-sugar>=0.9.5
# uiautomator2~=2.16.17
# requests~=2.28.1
# fastcap~=0.1.2
# findit~=0.5.9
# yagmail~=0.15.280
# jinja2~=3.1.2
# pydantic~=1.9.1
# JPype1==1.4.0
# paramiko~=2.11.0
# PyMySQL>=1.0.2
# opencv-python==4.5.1.48
# Pillow>=8.4.0

